home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / cat3 / Xm / GlxDraw.z / GlxDraw
Text File  |  1998-10-30  |  56KB  |  859 lines

  1.  
  2.  
  3.  
  4.      GGGGllllxxxxDDDDrrrraaaawwww((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               GGGGllllxxxxDDDDrrrraaaawwww((((3333XXXX))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           GGGGllllxxxxDDDDrrrraaaawwww,,,, GGGGllllxxxxMMMMDDDDrrrraaaawwww ---- GGGGLLLL ddddrrrraaaawwwwiiiinnnngggg wwwwiiiiddddggggeeeettttssss....
  10.  
  11.  
  12.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.           ####iiiinnnncccclllluuuuddddeeee <<<<SSSSggggmmmm////GGGGllllxxxxDDDDrrrraaaawwww....hhhh>>>>
  14.           wwwwiiiiddddggggeeeetttt ==== XXXXttttCCCCrrrreeeeaaaatttteeeeWWWWiiiiddddggggeeeetttt((((wwwwiiiiddddggggeeeetttt,,,, ggggllllxxxxDDDDrrrraaaawwwwWWWWiiiiddddggggeeeettttCCCCllllaaaassssssss,,,, ............))));;;;
  15.           lllldddd ............ ----llllSSSSggggmmmm ----llll<<<<aaaannnnyyyywwwwiiiiddddggggeeeettttlllliiiibbbbrrrraaaarrrryyyy>>>> ----llllXXXXtttt ----llllggggllll ----llllXXXX11111111 ............
  16.  
  17.           ####iiiinnnncccclllluuuuddddeeee <<<<SSSSggggmmmm////GGGGllllxxxxMMMMDDDDrrrraaaawwww....hhhh>>>>
  18.           wwwwiiiiddddggggeeeetttt ==== XXXXttttCCCCrrrreeeeaaaatttteeeeWWWWiiiiddddggggeeeetttt((((wwwwiiiiddddggggeeeetttt,,,, ggggllllxxxxMMMMDDDDrrrraaaawwwwWWWWiiiiddddggggeeeettttCCCCllllaaaassssssss,,,, ............))));;;;
  19.           lllldddd ............ ----llllSSSSggggmmmm ----llllXXXXmmmm ----llllXXXXtttt ----llllggggllll ----llllXXXX11111111 ............
  20.  
  21.  
  22.      VVVVEEEERRRRSSSSIIIIOOOONNNN
  23.           This page documents the version of Sgm that accompanies
  24.           Motif 2.1.
  25.  
  26.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  27.           GGGGllllxxxxDDDDrrrraaaawwww and GGGGllllxxxxMMMMDDDDrrrraaaawwww are widgets suitable for GL drawing.
  28.           They provide a window with the appropriate visual and
  29.           colormaps needed for GL, based on supplied parameters.
  30.           GlxDraw and GlxMdraw also provides callbacks for redraw,
  31.           resize, input, and initialization.
  32.  
  33.           GlxDraw is not a part of any widget set, but depends only on
  34.           Xt.  GlxDraw can be used with any widget set.  GlxMDraw is
  35.           identical to GlxDraw except that it is a subclass of the
  36.           Motif widget class XmPrimitive and has resources and
  37.           defaults suitable for use with Motif.  For example, GlxMDraw
  38.           provides the default Motif background and foreground colors
  39.           for resources, and deals better with keyboard traversal.
  40.           Although the GlxDraw widget can be used in a Motif program,
  41.           it is recommended that GlxMDraw be used instead.
  42.  
  43.           Since both GlxDraw and GlxMDraw widgets behave almost
  44.           identically, the remainder of this manual page will refer
  45.           only to GlxDraw, except when the behaviors differ.  Unless
  46.           explicitly stated, all statements about GlxDraw also apply
  47.           to GlxMDraw.
  48.  
  49.           To create a GlxDraw, the application must first set up a
  50.           GGGGLLLLXXXXccccoooonnnnffffiiiigggg structure as described in GGGGLLLLXXXXggggeeeettttccccoooonnnnffffiiiigggg((((3333GGGG)))).  The
  51.           GGGGLLLLXXXXccccoooonnnnffffiiiigggg structure describes the desired GL configuration
  52.           of the window being created, including information such as
  53.           single or double buffering, RGB vs.  color index mode, use
  54.           of the overlay planes, etc.  The GGGGLLLLXXXXccccoooonnnnffffiiiigggg parameter must be
  55.           passed in as the ggggllllxxxxCCCCoooonnnnffffiiiigggg resource when creating the
  56.           widget.  When created, the widget will automatically choose
  57.           the appropriate visual and colormap, as well as returning
  58.           the in the ggggllllxxxxCCCCoooonnnnffffiiiigggg resource the actual GL configuration
  59.           chosen.
  60.  
  61.  
  62.  
  63.      Page 1                                         (printed 10/24/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      GGGGllllxxxxDDDDrrrraaaawwww((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               GGGGllllxxxxDDDDrrrraaaawwww((((3333XXXX))))
  71.  
  72.  
  73.  
  74.           Creating the widget does not actually create the window
  75.           until it is realized, and consequently, the application
  76.           should not perform any GL to the window immediately after
  77.           creation.  Instead the application must wait until after it
  78.           has realized the window.  Alternatively, the ggggiiiinnnniiiitttt callback
  79.           may be used to indicate when the window has been created.
  80.           Upon receiving this callback, the application can perform
  81.           all GL initialization for the window, and can subsequently
  82.           perform other GL operations on it.  The initialization is
  83.           discussed in more detail below.
  84.  
  85.           The widget will create additional windows for overlays,
  86.           underlays, or popup planes if required, and if underlying
  87.           support is available.  The remainder of this manual page
  88.           will use the term aaaauuuuxxxxiiiilllliiiiaaaarrrryyyy wwwwiiiinnnnddddoooowwwwssss to refer to these
  89.           additional windows.  The main window in the normal planes
  90.           will be referred to as the nnnnoooorrrrmmmmaaaallll wwwwiiiinnnnddddoooowwww.
  91.  
  92.           If an application contains more than one GL window, it must
  93.           use the GGGGLLLLXXXXwwwwiiiinnnnsssseeeetttt((((3333GGGG)))) call before doing any GL operations to
  94.           a window.  This will select the appropriate window for the
  95.           operation.  There are two common situations where there is
  96.           more than one GL window.  One is where more than on GlxDraw
  97.           widget is used in a program.  The other is where auxiliary
  98.           windows are used.
  99.  
  100.           Normally, the call to GGGGLLLLXXXXwwwwiiiinnnnsssseeeetttt would be the first function
  101.           called in each callback.  Callbacks in this case include not
  102.           only callbacks provided by the widget itself, but any other
  103.           callback that leads to GL activity such as a timeout or a
  104.           workproc.  The call to GGGGLLLLXXXXwwwwiiiinnnnsssseeeetttt should be of the form
  105.                 GLXwinset(display, call_data->window);
  106.           Using the window passed in the call_data has two purposes
  107.           over using XtWindow(3X) to obtain the window.  First, it is
  108.           more efficient, since it avoids the function call.  Second,
  109.           if auxiliary windows are used, it obtains the correct window
  110.           if this is an expose callback.  For other callbacks it may
  111.           be necessary to use XXXXttttGGGGeeeettttVVVVaaaalllluuuueeeessss((((3333XXXX)))) to obtain the values of
  112.           GGGGllllxxxxNNNNoooovvvveeeerrrrllllaaaayyyyWWWWiiiinnnnddddoooowwww, GGGGllllxxxxNNNNuuuunnnnddddeeeerrrrllllaaaayyyyWWWWiiiinnnnddddoooowwww, or GGGGllllxxxxNNNNppppooooppppuuuuppppWWWWiiiinnnnddddoooowwww to
  113.           determine the proper parameter to GGGGLLLLXXXXwwwwiiiinnnnsssseeeetttt when using
  114.           auxiliary windows.
  115.  
  116.         GGGGllllxxxxDDDDrrrraaaawwww CCCCllllaaaasssssssseeeessss
  117.           GlxDraw inherits behavior and resources from the CCCCoooorrrreeee class.
  118.           The class pointer is ggggllllxxxxDDDDrrrraaaawwwwCCCCllllaaaassssssss.
  119.           The class name is GGGGllllxxxxDDDDrrrraaaawwww.
  120.  
  121.         GGGGllllxxxxMMMMDDDDrrrraaaawwww CCCCllllaaaasssssssseeeessss
  122.           GlxMDraw inherits behavior and resources from the
  123.           XXXXmmmmPPPPrrrriiiimmmmiiiittttiiiivvvveeee and CCCCoooorrrreeee classes.
  124.           The class pointer is ggggllllxxxxMMMMDDDDrrrraaaawwwwCCCCllllaaaassssssss.
  125.           The class name is GGGGllllxxxxMMMMDDDDrrrraaaawwww.
  126.  
  127.  
  128.  
  129.      Page 2                                         (printed 10/24/98)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      GGGGllllxxxxDDDDrrrraaaawwww((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               GGGGllllxxxxDDDDrrrraaaawwww((((3333XXXX))))
  137.  
  138.  
  139.  
  140.         NNNNeeeewwww RRRReeeessssoooouuuurrrrcccceeeessss
  141.           The following table defines a set of widget resources used
  142.           by the programmer to specify data.  The programmer can also
  143.           set the resource values for the inherited classes to set
  144.           attributes for this widget.  To reference a resource by name
  145.           or by class in a .Xdefaults file, remove the GGGGllllxxxxNNNN or GGGGllllxxxxCCCC
  146.           prefix and use the remaining letters.  The codes in the
  147.           access column indicate if the given resource can be set at
  148.           creation time (CCCC), set by using XXXXttttSSSSeeeettttVVVVaaaalllluuuueeeessss (SSSS), retrieved
  149.           by using XXXXttttGGGGeeeettttVVVVaaaalllluuuueeeessss (GGGG), or is not applicable (NNNN////AAAA).
  150.  
  151.      NNNNaaaammmmeeee                         CCCCllllaaaassssssss                  TTTTyyyyppppeeee             DDDDeeeeffffaaaauuuulllltttt     AAAAcccccccceeeessssssss
  152.      _______________________________________________________________________________________
  153.      GlxNexposeCallback           GlxCCallback           XtCallbackList   NULL        C
  154.      GlxNginitCallback            GlxCCallback           XtCallbackList   NULL        C
  155.      GlxNglxConfig                GlxCGlxConfig          GLXconfig*       {{0,0,0}}   CG
  156.      GlxNinputCallback            GlxCCallback           XtCallbackList   NULL        C
  157.      GlxNoverlayColormap          GlxCColormap           Colormap         dynamic     CG
  158.      GlxNoverlayDepth             GlxCDepth              int              dynamic     G
  159.      GlxNoverlayExposeCallback    GlxCCallback           XtCallbackList   NULL        C
  160.      GlxNoverlayVisual            GlxCVisual             XVisualInfo*     dynamic     G
  161.      GlxNoverlayWindow            GlxCWindow             Window           dynamic     G
  162.      GlxNresizeCallback           GlxCCallback           XtCallbackList   NULL        C
  163.      GlxNoverrideColormap         GlxCOverrideColormap   Boolean          TRUE        CG
  164.      GlxNpopupColormap            GlxCColormap           Colormap         dynamic     CG
  165.      GlxNpopupDepth               GlxCDepth              int              dynamic     G
  166.      GlxNpopupExposeCallback      GlxCCallback           XtCallbackList   NULL        C
  167.      GlxNpopupVisual              GlxCVisual             XVisualInfo*     dynamic     G
  168.      GlxNpopupWindow              GlxCWindow             Window           dynamic     G
  169.      GlxNunderlayColormap         GlxCColormap           Colormap         dynamic     CG
  170.      GlxNunderlayExposeCallback   GlxCCallback           XtCallbackList   NULL        C
  171.      GlxNunderlayDepth            GlxCDepth              int              dynamic     G
  172.      GlxNunderlayVisual           GlxCVisual             XVisualInfo*     dynamic     G
  173.      GlxNunderlayWindow           GlxCWindow             Window           dynamic     G
  174.      GlxNuseOverlay               GlxCUseOverlay         Boolean          FALSE       CG
  175.      GlxNusePopup                 GlxCUsePopup           Boolean          FALSE       CG
  176.      GlxNuseUnderlay              GlxCUseUndrlay         Boolean          FALSE       CG
  177.      GlxNvisual                   GlxCVisual             XVisualInfo*     Dynamic     G
  178.  
  179.  
  180.           GGGGllllxxxxNNNNeeeexxxxppppoooosssseeeeCCCCaaaallllllllbbbbaaaacccckkkk
  181.                Specifies the list of callbacks that is called when the
  182.                widget receives an exposure event.  The callback reason
  183.                is GGGGllllxxxxCCCCRRRR____EEEEXXXXPPPPOOOOSSSSEEEE.  The callback structure also includes
  184.                the exposure event.  The application will generally
  185.                want to redraw the scene.
  186.  
  187.           GGGGllllxxxxNNNNggggiiiinnnniiiittttCCCCaaaallllllllbbbbaaaacccckkkk
  188.                Specifies the list of callbacks that is called when the
  189.                widget is first realized.  Since no GL operations can
  190.                be done before the widget is realized, this callback
  191.                can be used to perform any appropriate GL
  192.  
  193.  
  194.  
  195.      Page 3                                         (printed 10/24/98)
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.      GGGGllllxxxxDDDDrrrraaaawwww((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               GGGGllllxxxxDDDDrrrraaaawwww((((3333XXXX))))
  203.  
  204.  
  205.  
  206.                initialization.  The callback reason is GGGGllllxxxxCCCCRRRR____GGGGIIIINNNNIIIITTTT.
  207.  
  208.           GGGGllllxxxxNNNNggggllllxxxxCCCCoooonnnnffffiiiigggg
  209.                On widget creation, specifies the GL configuration
  210.                information that is to be passed to GGGGLLLLXXXXggggeeeettttccccoooonnnnffffiiiigggg((((3333GGGG)))).
  211.                The default is an empty configuration structure,
  212.                providing the same default as GGGGLLLLXXXXggggeeeettttccccoooonnnnffffiiiigggg After the
  213.                widget is created, the actual configuration chosen can
  214.                be obtained by doing an XXXXttttGGGGeeeettttVVVVaaaalllluuuueeeessss((((3333XXXXtttt)))) on this
  215.                resource.  The passed in configuration structure may be
  216.                freed after the widget is created.
  217.  
  218.           GGGGllllxxxxNNNNiiiinnnnppppuuuuttttCCCCaaaallllllllbbbbaaaacccckkkk
  219.                Specifies the list of callbacks that is called when the
  220.                widget receives a keyboard or mouse event.  By default,
  221.                the input callback is called on each key press and key
  222.                release, on each mouse button press and release, and
  223.                whenever the mouse is moved while a button is pressed.
  224.                However this can be changed by providing a different
  225.                translation table. The callback structure also includes
  226.                the input event.  The callback reason is GGGGllllxxxxCCCCRRRR____IIIINNNNPPPPUUUUTTTT.
  227.  
  228.                The input callback is provided as a programming
  229.                convenience, as it provides a convenient way to catch
  230.                all input events.  However, a more modular program can
  231.                often be obtained by providing specific actions and
  232.                translations in the application rather than using a
  233.                single catch all callback.  Use of explicit
  234.                translations can also provide for more customizability.
  235.  
  236.           GGGGllllxxxxNNNNoooovvvveeeerrrrllllaaaayyyyCCCCoooolllloooorrrrmmmmaaaapppp
  237.                Specifies the colormap to use in the overlay planes.
  238.                It is only meaningful if overlay planes were selected
  239.                in the configuration.  If the colormap is not provided
  240.                when the widget is created, the colormap returned by
  241.                GGGGLLLLXXXXggggeeeettttccccoooonnnnffffiiiigggg((((3333XXXX)))) will be used.  If a colormap is
  242.                provided, it is the application programmer's
  243.                responsible for guaranteeing that the colormap is
  244.                compatible with the depths of the overlay planes.  Note
  245.                that unlike the normal window, it is not necessary to
  246.                specify an additional resource stating whether the
  247.                colormap should be used; it will always be used if
  248.                provided.
  249.  
  250.           GGGGllllxxxxNNNNoooovvvveeeerrrrllllaaaayyyyDDDDeeeepppptttthhhh
  251.                Returns the depth of the overlay.  It is only
  252.                meaningful if the overlays are in use.
  253.  
  254.           GGGGllllxxxxNNNNoooovvvveeeerrrrllllaaaayyyyEEEExxxxppppoooosssseeeeCCCCaaaallllllllbbbbaaaacccckkkk
  255.                Specifies the list of callbacks that is called when the
  256.                overlay receives an exposure event.  The callback
  257.                reason is GGGGllllxxxxCCCCRRRR____EEEEXXXXPPPPOOOOSSSSEEEE.  The callback structure also
  258.  
  259.  
  260.  
  261.      Page 4                                         (printed 10/24/98)
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.      GGGGllllxxxxDDDDrrrraaaawwww((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               GGGGllllxxxxDDDDrrrraaaawwww((((3333XXXX))))
  269.  
  270.  
  271.  
  272.                includes the exposure event.  The application will
  273.                generally want to redraw the overlay.
  274.  
  275.           GGGGllllxxxxNNNNoooovvvveeeerrrrllllaaaayyyyVVVViiiissssuuuuaaaallll
  276.                Returns the visual for the overlay.  It is only
  277.                meaningful if the overlays are in use.
  278.  
  279.           GGGGllllxxxxNNNNoooovvvveeeerrrrllllaaaayyyyWWWWiiiinnnnddddoooowwww
  280.                Returns the window that is used for the overlay.  It is
  281.                only meaningful if the overlays are in use.
  282.  
  283.           GGGGllllxxxxNNNNoooovvvveeeerrrrrrrriiiiddddeeeeCCCCoooolllloooorrrrmmmmaaaapppp
  284.                If TRUE, specifies that the colormap returned by
  285.                GGGGLLLLXXXXggggeeeettttccccoooonnnnffffiiiigggg should be installed by the widget.  In
  286.                this case, the XXXXttttNNNNccccoooolllloooorrrrmmmmaaaapppp Core resource will be
  287.                overridden when the widget is created.  After creating
  288.                the widget, the XXXXttttNNNNccccoooolllloooorrrrmmmmaaaapppp resource is set to the new
  289.                colormap.  This is the default case.  If
  290.                GGGGllllxxxxNNNNoooovvvveeeerrrrrrrriiiiddddeeeeCCCCoooolllloooorrrrmmmmaaaapppp is FALSE, the colormap specified
  291.                in the XXXXttttNNNNccccoooolllloooorrrrmmmmaaaapppp Core resource will be used.   When
  292.                setting this resource to FALSE, the programmer is
  293.                responsible for making sure that the colormap is
  294.                consistent with the request parameters to GGGGLLLLXXXXggggeeeettttccccoooonnnnffffiiiigggg
  295.                such as the depth.  Specifying an inconsistent colormap
  296.                will result in an X Bad Match error.  This resource
  297.                only has an effect if set at widget creation time.
  298.  
  299.           GGGGllllxxxxNNNNppppooooppppuuuuppppCCCCoooolllloooorrrrmmmmaaaapppp
  300.                Similar to GGGGllllxxxxNNNNoooovvvveeeerrrrllllaaaayyyyCCCCoooolllloooorrrrmmmmaaaapppp, but for the popup
  301.                planes.
  302.  
  303.           GGGGllllxxxxNNNNppppooooppppuuuuppppDDDDeeeepppptttthhhh
  304.                Similar to GGGGllllxxxxNNNNoooovvvveeeerrrrllllaaaayyyyDDDDeeeepppptttthhhh, but for the popup planes.
  305.  
  306.           GGGGllllxxxxNNNNppppooooppppuuuuppppEEEExxxxppppoooosssseeeeCCCCaaaallllllllbbbbaaaacccckkkk
  307.                Similar to GGGGllllxxxxNNNNoooovvvveeeerrrrllllaaaayyyyCCCCaaaallllllllbbbbaaaacccckkkk, but for the popup
  308.                planes.
  309.  
  310.           GGGGllllxxxxNNNNppppooooppppuuuuppppVVVViiiissssuuuuaaaallll
  311.                Similar to GGGGllllxxxxNNNNoooovvvveeeerrrrllllaaaayyyyVVVViiiissssuuuuaaaallll, but for the popup planes.
  312.  
  313.           GGGGllllxxxxNNNNppppooooppppuuuuppppWWWWiiiinnnnddddoooowwww
  314.                Similar to GGGGllllxxxxNNNNoooovvvveeeerrrrllllaaaayyyyWWWWiiiinnnnddddoooowwww, but for the popup planes.
  315.  
  316.           GGGGllllxxxxNNNNrrrreeeessssiiiizzzzeeeeCCCCaaaallllllllbbbbaaaacccckkkk
  317.                Specifies the list of callbacks that is called when the
  318.                GlxDraw is resized.  The callback reason is
  319.                GGGGllllxxxxCCCCRRRR____RRRREEEESSSSIIIIZZZZEEEE.  The application may wish to call
  320.                vvvviiiieeeewwwwppppoooorrrrtttt((((3333GGGG)))) using the supplied width and height
  321.                parameters, and then redraw the scene.
  322.  
  323.           GGGGllllxxxxNNNNuuuunnnnddddeeeerrrrllllaaaayyyyCCCCoooolllloooorrrrmmmmaaaapppp
  324.  
  325.  
  326.  
  327.      Page 5                                         (printed 10/24/98)
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.      GGGGllllxxxxDDDDrrrraaaawwww((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               GGGGllllxxxxDDDDrrrraaaawwww((((3333XXXX))))
  335.  
  336.  
  337.  
  338.                Similar to GGGGllllxxxxNNNNoooovvvveeeerrrrllllaaaayyyyCCCCoooolllloooorrrrmmmmaaaapppp, but for the underlay
  339.                planes.  Note that underlay support is not currently
  340.                provided in GLX.
  341.  
  342.           GGGGllllxxxxNNNNuuuunnnnddddeeeerrrrllllaaaayyyyDDDDeeeepppptttthhhh
  343.                Similar to GGGGllllxxxxNNNNoooovvvveeeerrrrllllaaaayyyyDDDDeeeepppptttthhhh, but for the underlay
  344.                planes.  Note that underlay support is not currently
  345.                provided in GLX.
  346.  
  347.           GGGGllllxxxxNNNNuuuunnnnddddeeeerrrrllllaaaayyyyEEEExxxxppppoooosssseeeeCCCCaaaallllllllbbbbaaaacccckkkk
  348.                Similar to GGGGllllxxxxNNNNoooovvvveeeerrrrllllaaaayyyyCCCCaaaallllllllbbbbaaaacccckkkk, but for the underlay
  349.                planes.  Note that underlay support is not currently
  350.                provided in GLX.
  351.  
  352.           GGGGllllxxxxNNNNuuuunnnnddddeeeerrrrllllaaaayyyyVVVViiiissssuuuuaaaallll
  353.                Similar to GGGGllllxxxxNNNNoooovvvveeeerrrrllllaaaayyyyVVVViiiissssuuuuaaaallll, but for the underlay
  354.                planes.  Note that underlay support is not currently
  355.                provided in GLX.
  356.  
  357.           GGGGllllxxxxNNNNuuuunnnnddddeeeerrrrllllaaaayyyyWWWWiiiinnnnddddoooowwww
  358.                Similar to GGGGllllxxxxNNNNoooovvvveeeerrrrllllaaaayyyyWWWWiiiinnnnddddoooowwww, but for the underlay
  359.                planes.  Note that underlay support is not currently
  360.                provided in GLX.
  361.  
  362.           GGGGllllxxxxNNNNuuuusssseeeeOOOOvvvveeeerrrrllllaaaayyyy
  363.                To use the overlays this must be set to TRUE when
  364.                creating the widget.
  365.  
  366.           GGGGllllxxxxNNNNuuuusssseeeePPPPooooppppuuuupppp
  367.                To use the popup planes this must be set to TRUE when
  368.                creating the widget.
  369.  
  370.           GGGGllllxxxxNNNNuuuusssseeeeUUUUnnnnddddeeeerrrrllllaaaayyyy
  371.                To use the underlays this must be set to TRUE when
  372.                creating the widget.  Note that underlay support is not
  373.                currently provided in GLX.
  374.  
  375.           GGGGllllxxxxNNNNvvvviiiissssuuuuaaaallll
  376.                Specifies the normal window's visual.  It is always
  377.                computed when the widget is created, and cannot be
  378.                specified by the application.
  379.  
  380.  
  381.         IIIInnnnhhhheeeerrrriiiitttteeeedddd RRRReeeessssoooouuuurrrrcccceeeessss
  382.           Both GlxDraw and GlxMDraw inherit behavior and resources
  383.           from the core superclass.  For a complete description of
  384.           each resource, refer to the man page for that superclass.
  385.           Motif programmers may use XXXXmmmm prefixes instead of XXXXtttt prefixes
  386.           where appropriate.
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.      Page 6                                         (printed 10/24/98)
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.      GGGGllllxxxxDDDDrrrraaaawwww((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               GGGGllllxxxxDDDDrrrraaaawwww((((3333XXXX))))
  401.  
  402.  
  403.  
  404.      NNNNaaaammmmeeee                            CCCCllllaaaassssssss                           TTTTyyyyppppeeee             DDDDeeeeffffaaaauuuulllltttt               AAAAcccccccceeeessssssss
  405.      _____________________________________________________________________________________________________________
  406.      XtNaccelerators                 XtCAccelerators                 XtAccelerators   dynamic               CSG
  407.      XtNancestorSensitive            XtCSensitive                    Boolean          dynamic               G
  408.      XtNbackground                   XtCBackground                   Pixel            dynamic               CSG
  409.      XtNbackgroundPixmap             XtCPixmap                       Pixmap           unspecified           CSG
  410.      XtNborderColor                  XtCBorderColor                  Pixel            XtDefaultForeground   CSG
  411.      XtNborderPixmap                 XtCPixmap                       Pixmap           unspecified           CSG
  412.      XtNborderWidth                  XtCBorderWidth                  Dimension        0                     CSG
  413.      XtNcolormap                     XtCColormap                     Colormap         dynamic               CG
  414.      XtNdepth                        XtCDepth                        int              dynamic               G
  415.      XtNdestroyCallback              XtCCallback                     XtCallbackList   NULL                  C
  416.      XtNheight                       XtCHeight                       Dimension        dynamic               CSG
  417.      XtNinitialResourcesPersistent   XtCInitialResourcesPersistent   Boolean          True                  C
  418.      XtNmappedWhenManaged            XtCMappedWhenManaged            Boolean          True                  CSG
  419.      XtNscreen                       XtCScreen                       Screen *         dynamic               CG
  420.      XtNsensitive                    XtCSensitive                    Boolean          True                  CSG
  421.      XtNtranslations                 XtCTranslations                 XtTranslations   dynamic               CSG
  422.      XtNwidth                        XtCWidth                        Dimension        dynamic               CSG
  423.      XtNx                            XtCPosition                     Position         0                     CSG
  424.      XtNy                            XtCPosition                     Position         0                     CSG
  425.  
  426.           A few of the resources above behave somewhat differently in
  427.           the GL widget.  XXXXttttNNNNddddeeeepppptttthhhh is calculated when the visual is
  428.           created; the depth cannot be specified explicitly except
  429.           indirectly through the GGGGllllxxxxNNNNggggllllxxxxCCCCoooonnnnffffiiiigggg resource.  If
  430.           GGGGllllxxxxNNNNoooovvvveeeerrrrrrrriiiiddddeeeeCCCCoooolllloooorrrrmmmmaaaapppp is TRUE, than the default for
  431.           GGGGllllxxxxNNNNccccoooolllloooorrrrmmmmaaaapppp is to calculate it dynamically based on the
  432.           GGGGllllxxxxNNNNggggllllxxxxCCCCoooonnnnffffiiiigggg parameter.
  433.  
  434.           In addition, the Motif version GlxMDraw also inherits from
  435.           XmPrimitive.
  436.      NNNNaaaammmmeeee                    CCCCllllaaaassssssss                   TTTTyyyyppppeeee               DDDDeeeeffffaaaauuuulllltttt                AAAAcccccccceeeessssssss
  437.      ________________________________________________________________________________________________
  438.      XmNbottomShadowColor    XmCBottomShadowColor    Pixel              dynamic                CSG
  439.      XmNbottomShadowPixmap   XmCBottomShadowPixmap   Pixmap             XmUNSPECIFIED_PIXMAP   CSG
  440.      XmNforeground           XmCForeground           Pixel              dynamic                CSG
  441.      XmNhelpCallback         XmCCallback             XtCallbackList     NULL                   C
  442.      XmNhighlightColor       XmCHighlightColor       Pixel              dynamic                CSG
  443.      XmNhighlightOnEnter     XmCHighlightOnEnter     Boolean            False                  CSG
  444.      XmNhighlightPixmap      XmCHighlightPixmap      Pixmap             dynamic                CSG
  445.      XmNhighlightThickness   XmCHighlightThickness   Dimension          0                      G
  446.      XmNnavigationType       XmCNavigationType       XmNavigationType   XmNONE                 G
  447.      XmNshadowThickness      XmCShadowThickness      Dimension          0                      G
  448.      XmNtopShadowColor       XmCTopShadowColor       Pixel              dynamic                CSG
  449.      XmNtopShadowPixmap      XmCTopShadowPixmap      Pixmap             dynamic                CSG
  450.      XmNtraversalOn          XmCTraversalOn          Boolean            False                  CSG
  451.      XmNunitType             XmCUnitType             unsigned char      dynamic                CSG
  452.      XmNuserData             XmCUserData             Pointer            NULL                   CSG
  453.  
  454.           The resources XXXXmmmmNNNNhhhhiiiigggghhhhlllliiiigggghhhhttttTTTThhhhiiiicccckkkknnnneeeessssssss and XXXXmmmmNNNNsssshhhhaaaaddddoooowwwwTTTThhhhiiiicccckkkknnnneeeessssssss
  455.           are unsupported and may not be changed.
  456.  
  457.  
  458.  
  459.      Page 7                                         (printed 10/24/98)
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.      GGGGllllxxxxDDDDrrrraaaawwww((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               GGGGllllxxxxDDDDrrrraaaawwww((((3333XXXX))))
  467.  
  468.  
  469.  
  470.         CCCCaaaallllllllbbbbaaaacccckkkk IIIInnnnffffoooorrrrmmmmaaaattttiiiioooonnnn
  471.           A pointer to the following structure is passed to each
  472.           callback:
  473.  
  474.           ttttyyyyppppeeeeddddeeeeffff ssssttttrrrruuuucccctttt
  475.           {
  476.             iiiinnnntttt      _r_e_a_s_o_n;
  477.             XXXXEEEEvvvveeeennnntttt   * _e_v_e_n_t;
  478.             WWWWiiiinnnnddddoooowwww   _w_i_n_d_o_w;
  479.             iiiinnnntttt      _b_u_f_f_e_r;
  480.             DDDDiiiimmmmeeeennnnssssiiiioooonnnn_w_i_d_t_h, _h_e_i_g_h_t;
  481.           } GGGGllllxxxxDDDDrrrraaaawwwwCCCCaaaallllllllbbbbaaaacccckkkkSSSSttttrrrruuuucccctttt;
  482.  
  483.  
  484.           _r_e_a_s_o_n Indicates why the callback was invoked.  Appropriate
  485.                  values are stated in the above resource descriptions.
  486.                  For Motif programmers, the values GGGGllllxxxxCCCCRRRR____EEEEXXXXPPPPOOOOSSSSEEEE,
  487.                  GGGGllllxxxxCCCCRRRR____RRRREEEESSSSIIIIZZZZEEEE, and GGGGllllxxxxCCCCRRRR____IIIINNNNPPPPUUUUTTTT are equal to
  488.                  XXXXmmmmCCCCRRRR____EEEEXXXXPPPPOOOOSSSSEEEE, XXXXmmmmCCCCRRRR____RRRREEEESSSSIIIIZZZZEEEE, and XXXXmmmmCCCCRRRR____IIIINNNNPPPPUUUUTTTT
  489.                  respectively.  GGGGllllxxxxCCCCRRRR____GGGGIIIINNNNIIIITTTT does not have a Motif
  490.                  equivalent.
  491.  
  492.           _e_v_e_n_t  Points to the XXXXEEEEvvvveeeennnntttt that triggered the callback.
  493.                  This is NULL for GGGGllllxxxxNNNNggggiiiinnnniiiittttCCCCaaaallllllllbbbbaaaacccckkkk aaaannnndddd
  494.                  GGGGllllxxxxNNNNrrrreeeessssiiiizzzzeeeeCCCCaaaallllllllbbbbaaaacccckkkk....
  495.  
  496.           _w_i_n_d_o_w Is set to the appropriate window.  Generally, this is
  497.                  the normal window.  However, for the auxiliary expose
  498.                  callbacks, this is the appropriate auxiliary window.
  499.  
  500.           _b_u_f_f_e_r Is the buffer type of wwwwiiiinnnnddddoooowwww (as described in
  501.                  GLXgetconfig(3G)).  It is one of GGGGLLLLXXXX____NNNNOOOORRRRMMMMAAAALLLL,
  502.                  GGGGLLLLXXXX____OOOOVVVVEEEERRRRLLLLAAAAYYYY, GGGGLLLLXXXX____UUUUNNNNDDDDEEEERRRRLLLLAAAAYYYY, and GGGGLLLLXXXX____PPPPOOOOPPPPUUUUPPPP.
  503.  
  504.           _w_i_d_t_h and _h_e_i_g_h_t
  505.                  Are set to the width and height of the window.
  506.  
  507.  
  508.         TTTTrrrraaaannnnssssllllaaaattttiiiioooonnnnssss
  509.           GlxDraw has the translations listed below.
  510.  
  511.           <<<<KKKKeeeeyyyyDDDDoooowwwwnnnn>>>>::::     ggggllllxxxxIIIInnnnppppuuuutttt(((())))
  512.           <<<<KKKKeeeeyyyyUUUUpppp>>>>::::       ggggllllxxxxIIIInnnnppppuuuutttt(((())))
  513.           <<<<BBBBttttnnnnDDDDoooowwwwnnnn>>>>::::     ggggllllxxxxIIIInnnnppppuuuutttt(((())))
  514.           <<<<BBBBttttnnnnUUUUpppp>>>>::::       ggggllllxxxxIIIInnnnppppuuuutttt(((())))
  515.           <<<<BBBBttttnnnnMMMMoooottttiiiioooonnnn>>>>::::   ggggllllxxxxIIIInnnnppppuuuutttt(((())))
  516.  
  517.           GlxMDraw has the following additional translation:
  518.  
  519.           <<<<KKKKeeeeyyyy>>>>oooossssffffHHHHeeeellllpppp::::  PPPPrrrriiiimmmmiiiittttiiiivvvveeeeHHHHeeeellllpppp(((())))
  520.  
  521.           An application wishing to catch other events than these
  522.  
  523.  
  524.  
  525.      Page 8                                         (printed 10/24/98)
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.      GGGGllllxxxxDDDDrrrraaaawwww((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               GGGGllllxxxxDDDDrrrraaaawwww((((3333XXXX))))
  533.  
  534.  
  535.  
  536.           defaults can do so by installing a different translation
  537.           table.
  538.  
  539.  
  540.  
  541.         AAAAccccttttiiiioooonnnn RRRRoooouuuuttttiiiinnnneeeessss
  542.           The GlxDraw has the following action routine:
  543.  
  544.           ggggllllxxxxIIIInnnnppppuuuutttt(((()))):
  545.                Called whenever one of the above translations specifies
  546.                that input has occurred.  Its sole purpose is to call
  547.                the input callback.
  548.  
  549.  
  550.      IIIINNNNIIIITTTTIIIIAAAALLLLIIIIZZZZAAAATTTTIIIIOOOONNNN
  551.           When the widget is initially created (e.g. through
  552.           XXXXttttCCCCrrrreeeeaaaatttteeeeWWWWiiiiddddggggeeeetttt((((3333XXXX))))) the associated window is not actually
  553.           created.  Instead, window creation is delayed until the
  554.           widget is realized.  However, GGGGLLLLXXXXggggeeeettttccccoooonnnnffffiiiigggg((((3333GGGG)))) is called
  555.           immediately, so information based on its results is
  556.           available.
  557.  
  558.           Between the time the widget is created and it is realized,
  559.           the following apply:
  560.  
  561.           +o    No GL operations can be done to the window
  562.  
  563.           +o    No resize callbacks are generated.
  564.  
  565.           +o    Neither the normal window nor the auxiliary windows are
  566.                available.
  567.  
  568.           When the widget is realized, the following actions take
  569.           place:
  570.  
  571.           +o    The normal window and any auxiliary windows are
  572.                created.
  573.  
  574.           +o    GGGGLLLLXXXXlllliiiinnnnkkkk((((3333GGGG)))) is called.  An application using the
  575.                GlxDraw widget should never need to call GGGGLLLLXXXXlllliiiinnnnkkkk((((3333GGGG)))).
  576.                (Similarly it should never need to call GGGGLLLLXXXXuuuunnnnlllliiiinnnnkkkk((((3333GGGG))))
  577.                as that is called when the widget is destroyed.)
  578.  
  579.           +o    GGGGLLLLXXXXwwwwiiiinnnnsssseeeetttt((((3333GGGG)))) is called on the normal window.  If an
  580.                application has only one GL window, it need never call
  581.                GGGGLLLLXXXXwwwwiiiinnnnsssseeeetttt((((3333GGGG)))).
  582.  
  583.           +o    The ggggiiiinnnniiiitttt callback is called.  The user may use this
  584.                callback to perform any needed GL initialization to the
  585.                window.
  586.  
  587.           The GlxDraw widget will generally use a different colormap
  588.  
  589.  
  590.  
  591.      Page 9                                         (printed 10/24/98)
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.      GGGGllllxxxxDDDDrrrraaaawwww((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               GGGGllllxxxxDDDDrrrraaaawwww((((3333XXXX))))
  599.  
  600.  
  601.  
  602.           than the X based portion of the application.  The colormap
  603.           may need to be installed using XXXXSSSSeeeettttWWWWMMMMCCCCoooolllloooorrrrmmmmaaaappppWWWWiiiinnnnddddoooowwwwssss((((3333XXXX11111111)))).
  604.           (Auxiliary windows will also need their colormaps installed,
  605.           as describe in the next section.)
  606.  
  607.  
  608.      OOOOVVVVEEEERRRRLLLLAAAAYYYYSSSS,,,, UUUUNNNNDDDDEEEERRRRLLLLAAAAYYYYSSSS,,,, aaaannnndddd PPPPOOOOPPPPUUUUPPPP PPPPLLLLAAAANNNNEEEESSSS
  609.           To include auxiliary windows, the following steps must be
  610.           taken:
  611.  
  612.           +o    Verify that there is support for the appropriate type
  613.                of auxiliary window.  Not all hardware supports
  614.                overlays.  Currently, the underlying GLX does not
  615.                support underlays.
  616.  
  617.           +o    Set the GGGGllllxxxxNNNNuuuusssseeeeOOOOvvvveeeerrrrllllaaaayyyy, GGGGllllxxxxNNNNuuuusssseeeeUUUUnnnnddddeeeerrrrllllaaaayyyy, or
  618.                GGGGllllxxxxNNNNuuuusssseeeePPPPooooppppuuuupppp resources as appropriate to TRUE.
  619.  
  620.           +o    Set the appropriate entries in the GGGGllllxxxxNNNNccccoooonnnnffffiiiigggg parameter
  621.                as described in GGGGLLLLXXXXggggeeeettttccccoooonnnnffffiiiigggg((((3333GGGG)))).
  622.  
  623.           +o    Create the widget as normal.
  624.  
  625.           +o    Make sure that the auxiliary colormap is installed
  626.                along with the GlxDraw colormap using
  627.                XXXXSSSSeeeettttWWWWMMMMCCCCoooolllloooorrrrmmmmaaaappppWWWWiiiinnnnddddoooowwwwssss((((3333XXXX11111111)))).  (Note that the call to
  628.                XXXXSSSSeeeettttWWWWMMMMCCCCoooolllloooorrrrmmmmaaaappppWWWWiiiinnnnddddoooowwwwssss((((3333XXXX11111111)))) will usually specify three
  629.                windows in this case:  the overlay window, the GlxDraw
  630.                window, and the top level window.)
  631.  
  632.           +o    Provide an expose callback routine for each auxiliary
  633.                used, by setting GGGGllllxxxxNNNNoooovvvveeeerrrrllllaaaayyyyEEEExxxxppppoooosssseeeeCCCCaaaallllllllbbbbaaaacccckkkk,
  634.                GGGGllllxxxxNNNNuuuunnnnddddeeeerrrrllllaaaayyyyEEEExxxxppppoooosssseeeeCCCCaaaallllllllbbbbaaaacccckkkk, or GGGGllllxxxxNNNNppppooooppppuuuuppppEEEExxxxppppoooosssseeeeCCCCaaaallllllllbbbbaaaacccckkkk.
  635.  
  636.           +o    Before drawing to an auxiliary window, do a
  637.                GGGGLLLLXXXXwwwwiiiinnnnsssseeeetttt((((3333GGGG)))) to that window.  The window ID can be
  638.                obtained from the callback if the drawing is in
  639.                response to an expose, or by querying the
  640.                GGGGllllxxxxNNNNoooovvvveeeerrrrllllaaaayyyyWWWWiiiinnnnddddoooowwww, GGGGllllxxxxNNNNuuuunnnnddddeeeerrrrllllaaaayyyyWWWWiiiinnnnddddoooowwww or
  641.                GGGGllllxxxxNNNNppppooooppppuuuuppppWWWWiiiinnnnddddoooowwww resources.
  642.  
  643.  
  644.      NNNNOOOOTTTTEEEESSSS
  645.           When using the input callback to receive keyboard input, the
  646.           keycode in the event must be converted to a KeySym.  Use
  647.           XXXXLLLLooooooookkkkuuuuppppKKKKeeeeyyyyssssyyyymmmm((((3333XXXX)))) or XXXXLLLLooooooookkkkuuuuppppSSSSttttrrrriiiinnnngggg((((3333XXXX)))) to do the conversion.
  648.           Keyboard input can also be dealt using translations, in
  649.           which case no such conversion is required.
  650.  
  651.           GL programs will typically draw their backgrounds by using
  652.           cccclllleeeeaaaarrrr((((3333GGGG)))), ggggcccclllleeeeaaaarrrr((((3333GGGG)))), or some similar routine in a
  653.           specified color.  Thus, the XtNbackground resource will have
  654.  
  655.  
  656.  
  657.      Page 10                                        (printed 10/24/98)
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.      GGGGllllxxxxDDDDrrrraaaawwww((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               GGGGllllxxxxDDDDrrrraaaawwww((((3333XXXX))))
  665.  
  666.  
  667.  
  668.           no direct effect.  To get a matching background in GL, first
  669.           use XtGetValues on the XtNbackground resource to find the
  670.           background color and use that color explicitly.  However, be
  671.           aware that the background pixel was set relative to the
  672.           parent's colormap, not the GlxDraw widget's colormap.  Motif
  673.           programs may also choose to make use of the XtNforeground
  674.           resource in a similar manner.
  675.  
  676.           GL functions such as ggggeeeettttssssiiiizzzzeeee((((3333GGGG)))) and ggggeeeettttoooorrrriiiiggggiiiinnnn((((3333GGGG)))) require
  677.           round trips to the server and are thus slow.  It is quicker
  678.           to use XtGetValues to obtain the XtNx, XtNy, XtNheight, and
  679.           XtNwidth values directly from the widget.
  680.  
  681.           To work properly over the network using the Distributed
  682.           Graphics Library (DGL), applications may need to call
  683.           ggggfffflllluuuusssshhhh((((3333GGGG)))) after drawing using GL.  The end of each callback
  684.           and action routine is a good place to include the call.
  685.           Alternatively, if there is a common drawing routine used by
  686.           all callbacks and actions, the ggggfffflllluuuusssshhhh((((3333GGGG)))) call may be placed
  687.           at the end of that routine.
  688.  
  689.           Providing a user colormap is handled slightly differently
  690.           for normal and for auxiliary windows.  For normal windows,
  691.           the colormap is a standard Core resource for which a default
  692.           already exists.  Consequently, the default colormap will be
  693.           overridden by the result of GGGGLLLLXXXXggggeeeettttccccoooonnnnffffiiiigggg((((3333GGGG)))) unless
  694.           GGGGllllxxxxNNNNoooovvvveeeerrrrrrrriiiiddddeeeeCCCCoooolllloooorrrrmmmmaaaapppp resource is set to FALSE.  For
  695.           auxiliary windows, there is no preexisting default colormap,
  696.           so if a user provided colormap is provided, it will always
  697.           be used.
  698.  
  699.           Motif programmers should keep in mind that OSF uses virtual
  700.           bindings and replaces some of the key bindings.  As a common
  701.           example, if the ESC key is to be used to exit the program
  702.           (as it often is in GL programs), the translation should
  703.           specify <key>osfCancel instead of <key>Escape.
  704.  
  705.           Motif programmers may also create a GlxMDraw widget with the
  706.           Motif style GGGGllllxxxxCCCCrrrreeeeaaaatttteeeeMMMMDDDDrrrraaaawwww((((3333XXXX)))).
  707.  
  708.  
  709.      EEEEXXXXAAAAMMMMPPPPLLLLEEEE
  710.           Here are some code fragments that create a GlxDraw widget,
  711.           and manage the appropriate callbacks.
  712.  
  713.  
  714.              #include <Sgm/GlxDraw.h>
  715.              . . .
  716.              /* The following configuration should match your hardware needs as */
  717.              /* Described in GLXgetconfig(3X)                                   */
  718.              GLXconfig db_rgb_desc[] = {
  719.                 { GLX_NORMAL,GLX_RGB,TRUE },
  720.  
  721.  
  722.  
  723.      Page 11                                        (printed 10/24/98)
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.      GGGGllllxxxxDDDDrrrraaaawwww((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               GGGGllllxxxxDDDDrrrraaaawwww((((3333XXXX))))
  731.  
  732.  
  733.  
  734.                 { GLX_NORMAL,GLX_DOUBLE,TRUE },
  735.                 { 0, 0, 0 }
  736.              };
  737.  
  738.              main()
  739.              {
  740.                  Arg args[10];
  741.                  int n;
  742.  
  743.                  Widget parent;/* The parent of the gl widget */
  744.                  Widget glw;/* The glxDraw widget          */
  745.                  . . .
  746.                  n = 0;
  747.                  XtSetArg(args[n], GlxNglxConfig, db_rgb_desc); n++;
  748.                  glw = XtCreateManagedWidget("glx", glxDrawWidgetClass,
  749.                             parent, args, n);
  750.                  XtAddCallback(glw, GlxNexposeCallback, exposeCB, 0);
  751.                  XtAddCallback(glw, GlxNresizeCallback, resizeCB, 0);
  752.                  XtAddCallback(glw, GlxNginitCallback, ginitCB, 0);
  753.                  /* Also add input callback if need be */
  754.                  . . .
  755.              }
  756.  
  757.              static void
  758.              exposeCB(w, client_data, call_data)
  759.                  Widget w;
  760.                  caddr_t client_data;
  761.                  GlxDrawCallbackStruct *call_data;
  762.              {
  763.                  GLXwinset(display, call_data->window);
  764.                  /* redraw the display */
  765.              }
  766.  
  767.              static void
  768.              resizeCB(w, client_data, call_data)
  769.                  Widget w;
  770.                  caddr_t client_data;
  771.                  GlxDrawCallbackStruct *call_data;
  772.              {
  773.                  GLXwinset(display, call_data->window);
  774.                  viewport(0, (Screencoord) call_data->width-1,
  775.                          0, (Screencoord) call_data->height-1);
  776.                  /* redraw the display */
  777.              }
  778.  
  779.              static void
  780.              ginitCB(w, client_data, call_data)
  781.                  Widget w;
  782.                  caddr_t client_data;
  783.                  GlxDrawCallbackStruct *call_data;
  784.              {
  785.                  GLXwinset(display, call_data->window);
  786.  
  787.  
  788.  
  789.      Page 12                                        (printed 10/24/98)
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.      GGGGllllxxxxDDDDrrrraaaawwww((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               GGGGllllxxxxDDDDrrrraaaawwww((((3333XXXX))))
  797.  
  798.  
  799.  
  800.                  /* Perform any necessary graphics initialization.*/
  801.              }
  802.  
  803.  
  804.           The Motif program need only differ by including GGGGllllxxxxMMMMDDDDrrrraaaawwww....hhhh
  805.           instead of GGGGllllxxxxDDDDrrrraaaawwww....hhhh and by creating a widget of type
  806.           GGGGllllxxxxMMMMDDDDrrrraaaawwwwWWWWiiiiddddggggeeeettttCCCCllllaaaassssssss instead of GGGGllllxxxxDDDDrrrraaaawwwwWWWWiiiiddddggggeeeettttCCCCllllaaaassssssss.  As an
  807.           alternative, the Motif program could use GGGGllllxxxxCCCCrrrreeeeaaaatttteeeeMMMMDDDDrrrraaaawwww((((3333XXXX))))
  808.           instead.
  809.  
  810.  
  811.      WWWWAAAARRRRNNNNIIIINNNNGGGGSSSS
  812.           The GlxDraw should be used only for GL drawing.  Using X
  813.           drawing to a GlxDraw is unsupported.
  814.  
  815.           All color resources (e.g XXXXttttNNNNbbbbaaaacccckkkkggggrrrroooouuuunnnndddd) specify pixels in
  816.           the GlxDraw's parent's colormap.  Since GL does not directly
  817.           make use of these resources, this won't normally be a
  818.           problem.  However, if a program wishes to query such a color
  819.           (for example, to make a matching background in the GlxDraw
  820.           widget), it should use the parent's colormap.
  821.  
  822.           Colormaps should be installed using
  823.           XXXXSSSSeeeettttWWWWMMMMCCCCoooolllloooorrrrmmmmaaaappppWWWWiiiinnnnddddoooowwwwssss((((3333XXXX11111111)))).  This requests that the window
  824.           manager install the appropriate colormaps every time the
  825.           pointer enters the window.  Colormaps should not be
  826.           installed with XXXXIIIInnnnssssttttaaaallllllllCCCCoooolllloooorrrrmmmmaaaapppp((((3333XXXX11111111)))).
  827.  
  828.           If a GlxDraw widget is created as a child of an already
  829.           realized widget, the GlxDraw widget will be created
  830.           immediately, without giving the user an opportunity to add
  831.           the ggggiiiinnnniiiitttt callback.  In such a case, initialization should
  832.           be done immediately after creating the widget rather than by
  833.           using the callback.
  834.  
  835.           If the non-Motif GlxDraw widget is used in a Motif program
  836.           and keyboard traversal is attempted, the behavior is
  837.           undefined if the user traverses into the GlxDraw widget.
  838.  
  839.      RRRREEEELLLLAAAATTTTEEEEDDDD IIIINNNNFFFFOOOORRRRMMMMAAAATTTTIIIIOOOONNNN
  840.           GGGGLLLLXXXXggggeeeettttccccoooonnnnffffiiiigggg((((3333GGGG)))), GGGGLLLLXXXXwwwwiiiinnnnsssseeeetttt((((3333GGGG)))), GGGGllllxxxxCCCCrrrreeeeaaaatttteeeeMMMMDDDDrrrraaaawwww((((3333XXXX)))),
  841.           CCCCoooorrrreeee((((3333XXXX)))), XXXXmmmmPPPPrrrriiiimmmmiiiittttiiiivvvveeee((((3333XXXX)))), VVVViiiirrrrttttuuuuaaaallllBBBBiiiinnnnddddiiiinnnnggggssss((((3333XXXX)))), GGGGfffflllluuuusssshhhh((((3333GGGG)))),
  842.           XXXXSSSSeeeettttWWWWMMMMCCCCoooolllloooorrrrmmmmaaaappppWWWWiiiinnnnddddoooowwwwssss((((3333XXXX11111111)))) and the "IRIS NeWS to X
  843.           Transition Guide"
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.      Page 13                                        (printed 10/24/98)
  856.  
  857.  
  858.  
  859.